<include file="Public:header" />
<div id="test"></div>
<script type="text/javascript" src="/Public/Js/jquery1.10.2.min.js"></script>
<script type="text/javascript">
$(function () {
        var colors = Highcharts.getOptions().colors,
            sum = {$sum},
            categories = {$columnNum},
            name = '点击隐藏',
			data = {$columnData},
			year = {$Think.get.year},
			month = {$Think.get.month};

        function setChart(name, categories, data, color) {
			chart.xAxis[0].setCategories(categories, false);
			chart.series[0].remove(false);
			chart.addSeries({
				name: name,
				data: data,
				color: color || 'white'
			}, false);
			chart.redraw();
        }

        var chart = $('#container').highcharts({
            chart: {
                type: 'column'
            },
            title: {
                text: ''+year+'年'+month+'月份电话通话次数统计图！'
            },
            subtitle: {
                text: '以下统计为所选月份通话次数的统计柱形图'
            },
            xAxis: {
                categories: categories
            },
            yAxis: {
                title: {
                    text: '总量'+sum+'（单位：个）'
                }
            },
            plotOptions: {
                column: {
                    cursor: 'pointer',
                    point: {
                        events: {
                            click: function() {
                                var drilldown = this.drilldown;
                                if (drilldown) { // drill down
                                    setChart(drilldown.name, drilldown.categories, drilldown.data, drilldown.color);
                                } else { // restore
                                    setChart(name, categories, data);
                                }
                            }
                        }
                    },
                    dataLabels: {
                        enabled: true,
                        color: colors[0],
                        style: {
                            fontWeight: 'bold'
                        },
                        formatter: function() {
                            return this.y+'(个)';
                        }
                    }
                }
            },
            tooltip: {
                formatter: function() {
                    var point = this.point,
                        s = this.x +':<b>'+ this.y +'个</b><br/>';
                    if (point.drilldown) {
                        s += '点击查看 '+ point.category +'当日大图';
                    } else {
                        s += '点击返回查看本月电话量';
                    }
                    return s;
                }
            },
            series: [{
                name: name,
                data: data,
                color: 'white'
            }],
            exporting: {
                enabled: false
            }
        })
        .highcharts(); // return chart
    });

</script>
<script src="/Public/Highcharts/js/highcharts.js"></script>
<script src="/Public/Highcharts/js/modules/exporting.js"></script>
<div class="subnav">

  <div class="explain-col" style="position: relative;">
    <form name="searchForm" id="searchForm" method="GET" action="__ACTION__">
      统计分析：
      <select name="year" id="year" >
      		<option value="2016" selected="selected">2016年</option>
            <option value="2015" <eq name="Think.get.year" value="2015"> selected="selected"</eq> />2015年</option>
            <option value="2014" <eq name="Think.get.year" value="2014"> selected="selected"</eq> />2014年</option>
            <option value="2013" <eq name="Think.get.year" value="2013"> selected="selected"</eq> />2013年</option>
            <option value="2012" <eq name="Think.get.year" value="2012"> selected="selected"</eq> />2012年</option>
      </select>
      <select name="month" id="month" onchange="searchForm.submit()">
      		<volist name="monthArr" id="vo">
            	<option value="{$vo}" <eq name="Think.get.month" value="$vo"> selected="selected"</eq> >{$vo}月</option>
            </volist>
      </select>
      <span id="searchTime" style="display:none;">
      从：<input type="text" class="input-text Wdate" size="20" name="startTime" id="startTime" value="" onClick="WdatePicker({dateFmt:'yyyy-MM-dd'})" readonly="readonly" />
      到&nbsp;<input type="text" class="input-text Wdate" size="20" name="endTime" id="endTime" value="" onClick="WdatePicker({dateFmt:'yyyy-MM-dd'})" readonly="readonly" />
      </span>
      <eq name="showUserStatistics" value="1">
      <!-- <select name="userId" id="userId" onchange="searchForm.submit();" >
            <option value="0" selected="selected">请选择用户</option>
            <volist name="userList" id="vo">
            <option value="{$vo.id}" <eq name="Think.get.userId" value="$vo.id"> selected="selected"</eq> />{$vo.username}</option>
            </volist>
      </select> -->
      </eq>
      <input type="submit" value=" 搜索 " class="button" />
    </form>
      <div class="content-menu" style="position: absolute; right: 30px;top: 5px;"> <!-- 统计柱形图 --></div>
  </div>
</div>
<!--subnav-->
<div id="container" style="min-width: 310px; height: 400px; margin: 0 auto"></div>

</body>
</html>
